// @Author miaoqing
// @Date 2024/02/23 15:17:00
// @Desc
package logic

import "core/common"

func (srv *Server) registerGatewayServerTimer() {
	if srv.innerSvcID != "" && !srv.stopping.Load() {
		req := &common.AddServerReq{
			SI: &common.ServerInfo{
				ServerID: srv.innerSvcID,
				Addr:     srv.innerSrvAddr,
			},
		}
		_ = common.SendCenterHttpRequest(req, nil, "POST", "/addGatewayServer")
	}
}

func (srv *Server) registerTcpServerTimer() {
	if srv.tcpSvcID != "" && !srv.stopping.Load() {
		req := &common.AddServerReq{
			SI: &common.ServerInfo{
				ServerID: srv.tcpSvcID,
				Addr:     srv.tcpAddr,
				Port:     srv.tcpPort,
			},
		}
		_ = common.SendCenterHttpRequest(req, nil, "POST", "/addTcpServer")
	}
}
